package com.teamone.etl.apimanager.entity;

import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.teamone.etl.apimanager.valid.AddGroup;
import com.teamone.etl.apimanager.valid.UpdateGroup;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * 接口规则表(ApiRule)表实体类
 *
 * @author makejava
 * @since 2021-01-20 18:32:05
 */
@EqualsAndHashCode(callSuper = true)
@SuppressWarnings("serial")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ApiRule extends Model<ApiRule> {
    /**序号
     *
     */
    @NotNull(message = "规则Id不能为空",groups = {UpdateGroup.class})
    private Integer id;

    /**规则名称
     *
     */
    @NotEmpty(message = "规则名称不能为空",groups = {AddGroup.class,UpdateGroup.class})
    private String name;

    /**规则代码
     *
     */
    @NotEmpty(message = "规则代码不能为空",groups = {AddGroup.class,UpdateGroup.class})
    private String codes;

    /**规则描述
     *
     */
    private String description;

    /**状态，1启用，0禁用
     *
     */
    private Integer state;

    /**创建人
     *
     */
    private String createBy;

    /**创建时间
     *
     */
    private Date createTime;

    /**
     * 修改人
     */
    private String updateBy;

    /**修改时间
     *
     */
    private Date updateTime;

    /**
     * 逻辑删除
     */
    private Boolean isDelete;

    /**
     * 获取主键值
     *
     * @return 主键值
     */
    @Override
    protected Serializable pkVal() {
        return this.id;
    }
}